﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WmsApp.Window;

namespace WmsApp.WindowControl
{
    public interface IConfirmPayWrap
    {
        DateTime? ConfirmDate { get; }
        string PayTypeCode { get;  }
        string PayTypeName { get;  }
        bool IsConfirmOk { get; }
    }

    public class ConfirmPayWrap:IConfirmPayWrap
    {
        private FormConfirmPay form = null;
        public ConfirmPayWrap()
        {
            form = new FormConfirmPay();
            
            form.ShowDialog();
            if(form.DialogResult == DialogResult.OK)
            {
                ConfirmDate = form.InOutDate;
                PayTypeCode = form.PayTypeCode;
                PayTypeName = form.PayTypeName;
                IsConfirmOk = true;
            }
            else
            {
                ConfirmDate = null;
                PayTypeCode = null;
                PayTypeName = null;
                IsConfirmOk = false;
            }
        }

        public DateTime? ConfirmDate { get; private set; }
        public string PayTypeCode { get; private set; }
        public string PayTypeName { get; private set; }
        public bool IsConfirmOk { get; private set; }
    }
}
